﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>zyOffice form xheditor 1.x</title>
    <!--<script type="text/javascript" src="jquery/jquery-1.4.4.min.js"></script>-->
    <script type="text/javascript" src="zyoffice/js/json2.min.js" charset="utf-8"></script>
    <script type="text/javascript" src="zyoffice/js/jquery-1.4.min.js" charset="utf-8"></script>
    <script type="text/javascript" src="xheditor-1.1.13-zh-cn.min.js"></script>
    <link type="text/css" rel="Stylesheet" href="demo.css" />
    <link type="text/css" rel="Stylesheet" href="zyoffice/js/skygqbox.css" />
    <script type="text/javascript" src="zyoffice/js/skygqbox.js" charset="utf-8"></script>
    <script type="text/javascript" src="zyoffice/js/w.js" charset="utf-8"></script>
    <script type="text/javascript" src="vue.min.js" charset="utf-8"></script>
    <script type="text/javascript" src="demo.js" charset="utf-8"></script>
    <style type="text/css">
        .zyoffice {
            background: transparent url(zyoffice/css/w.png) no-repeat;
            background-position: 3px 2px;
        }

		.zywordexport {
            background: transparent url(zyoffice/css/exword.png) no-repeat;
            background-position: 3px 2px;
        }
		
		.zyofficepdf {
            background: transparent url(zyoffice/css/pdf.png) no-repeat;
            background-position: 3px 2px;
        }
    </style>
</head>
<body>    
    <div id="demos"></div>    
    <div id="xhe">
        <xheditor ref="xhe"></xheditor>
    </div>
    <script>
        Vue.component('xheditor', {
            data: function(){
                return {
                    editor: null
                }
            },
            props: {
                value: '',
                config: {}
            },
            mounted: function(){
                zyOffice.getInstance({
                    word: "http://localhost:13710/zyoffice/word/convert",
					wordExport:"http://localhost:13710/zyoffice/word/export",
					pdf:"http://localhost:13710/zyoffice/pdf/upload"                    
                });//加载控件

                var editor;
                $(pageInit);
                function pageInit() {
                    var allPlugin = {
                        zyoffice: { c: 'zyoffice', t: '导入Word文档（docx格式）', e: function () { zyOffice.getInstance().api.openDoc(); } }
						,zywordexport: { c: 'zywordexport', t: '导出Word文档（docx格式）', e: function() { zyOffice.getInstance().api.exportWord(); } }
						,zyofficepdf: { c: 'zyofficepdf', t: '导入PDF文档', e: function() { zyOffice.getInstance().api.openPdf(); } }
                    };
                    editor = $('#editor').xheditor({ plugins: allPlugin, tools: 'zyoffice,zywordexport,zyofficepdf,Source,Fullscreen,About' });
                    zyOffice.getInstance().SetEditor(editor);
                }
            },
            methods: {},
            destroyed: function(){},
            template: '<div><textarea id="editor" name="editor" rows="12" cols="80" style="width:560px;height:180px;"/></div>'
        });

        var xhe = new Vue({
            el: '#xhe',
            data: {
            }
            , mounted: function () {
            }
        });
    </script>
</body>
</html>
